using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Helper;
namespace CoreData
{
    public class LanguageDic
    {
            public long ID{get;set;}
            public string LanguageDicGuidID{get;set;}
            public string Code{get;set;}
            public string VN{get;set;}
            public string EN{get;set;}
         
        public LanguageDic()
        {       
                            LanguageDicGuidID =Guid.NewGuid().ToString();
                            Code ="";   
                            VN ="";   
                            EN ="";   
        }
        
       static LanguageDic DynamicCast<T>(object row_data, object row_header) where T : LanguageDic
       {
           // row_data : DataRow
           // row_header : DataColumnCollection
           LanguageDic ret = new LanguageDic();
           DataRow dt = (DataRow)row_data;

           foreach (DataColumn column in (DataColumnCollection)row_header)
           {
               switch (column.ColumnName)
               {
                      case  "ID":
                        ret.ID = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "LanguageDicGuidID":
                        ret.LanguageDicGuidID = ConvertObject.ToString(dt[column]);
                       break;
                      case  "Code":
                        ret.Code = ConvertObject.ToString(dt[column]);
                       break;
                      case  "VN":
                        ret.VN = ConvertObject.ToString(dt[column]);
                       break;
                      case  "EN":
                        ret.EN = ConvertObject.ToString(dt[column]);
                       break;
                
                   default:
                       break;
               }
           }

           return ret;
       }
        
    }
}
